package com.qingfeng.core.dao.qingfeng;

import com.qingfeng.core.config.database.BaseMapper;
import com.qingfeng.core.dao.BaseDao;
import com.qingfeng.core.entity.qingfeng.Splash;
import com.qingfeng.core.mapper.qingfeng.SplashMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @description: splash
 * @author:LWY
 * @date: 2017/11/17 14:44
 * @modified:
 */
@Repository
public class SplashDao extends BaseDao<Splash> {
    @Autowired
    SplashMapper splashMapper;


    @Override
    protected BaseMapper<Splash> getBaseMapper() {
        return splashMapper;
    }

    /**
     * 获取在线的splash
     */
    public List<Splash> getOnline() {
        Example example = new Example(Splash.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andCondition("state=", 1);
        example.setOrderByClause("splash_order asc");
        return splashMapper.selectByExample(example);
    }
}
